﻿<%@ Page Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true"
    CodeFile="student-registration.aspx.cs" Inherits="student_student_registration"
    Title="Untitled Page" MaintainScrollPositionOnPostback="true" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
    <title>Student Registration</title>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="bodyContentTop" runat="Server">
    <h1>
        Student Registration</h1>
    <h3>
        How many student registerations have in selected school?.</h3>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="bodyContent" runat="Server">
    <div class="elements_inner_wrapper">
        <div id="contentBody">
            <div class="section">
                <div class="seperator">
                </div>
                <fieldset class="formouter">
                    <table cellpadding="3" cellspacing="3" width="100%">
                        <tr>
                            <td colspan="2">
                                <asp:HyperLink runat="server" ID="hplStudentList" Text="View Listing" NavigateUrl="~/student/student-list.aspx"></asp:HyperLink>
                                &nbsp;&nbsp;<asp:HyperLink runat="server" ID="hplStudent" Text="Edit Details" NavigateUrl="~/student/default.aspx"></asp:HyperLink>
                                &nbsp;&nbsp;&nbsp;&nbsp;<asp:Label runat="server" ID="lblTopMessage" Text="" Font-Bold="true"
                                    Font-Size="Large" ForeColor="Red"></asp:Label>
                                <div class="row_curved" id="div3" runat="server" title="Example:UCSM, MIT, YTU">
                                    <label for="<%=lblStudentAccountIDCaption.ClientID%>" class="mand_red">
                                        <asp:Label runat="server" Text="Student ID" ID="lblStudentAccountIDCaption" /></label>
                                    <div class="field">
                                        <span class="indicator">
                                            <asp:Label Visible="false" runat="server" Text="-1" ID="lblUserAccountKey" />
                                            <asp:Label Visible="false" runat="server" Text="-1" ID="lblSRID" />
                                            <asp:Label Visible="true" runat="server" Text="-1" ID="lblStudentProfileKey" />
                                            <asp:Label Visible="false" runat="server" Text="0" ID="lblEditRegistration" />
                                        </span>
                                    </div>
                                    <div class="clear">
                                    </div>
                                </div>
                                <div class="row_curved" id="div1" runat="server" title="Example:UCSM, MIT, YTU">
                                    <label for="<%=lblFullNameCaption.ClientID%>" class="mand_red">
                                        <asp:Label runat="server" Text="Full Name" ID="lblFullNameCaption" /></label>
                                    <div class="field">
                                        <span class="indicator">
                                            <asp:Label runat="server" ID="lblFullName" />
                                        </span>
                                    </div>
                                    <div class="clear">
                                    </div>
                                </div>
                                <div class="row_curved" id="div2" runat="server" title="Example:UCSM, MIT, YTU">
                                    <label for="<%=lblContactInfoCaption.ClientID%>" class="mand_red">
                                        <asp:Label runat="server" Text="Contact Info" ID="lblContactInfoCaption" /></label>
                                    <div class="field">
                                        <span class="indicator">
                                            <asp:Label runat="server" ID="lblContactInfo" />
                                        </span>
                                    </div>
                                    <div class="clear">
                                    </div>
                                </div>
                                <div class="row_curved" id="div6" runat="server" title="Example:UCSM, MIT, YTU">
                                    <label for="<%=lblGuardianFullNameCaption.ClientID%>" class="mand_red">
                                        <asp:Label runat="server" Text="Guardian Name" ID="lblGuardianFullNameCaption" /></label>
                                    <div class="field">
                                        <span class="indicator">
                                            <asp:Label runat="server" ID="lblGuardianFullName" />
                                        </span>
                                    </div>
                                    <div class="clear">
                                    </div>
                                </div>
                                <div class="row_curved" id="div5" runat="server" title="Example:UCSM, MIT, YTU">
                                    <label for="<%=lblGuardianContactInfoCaption.ClientID%>" class="mand_red">
                                        <asp:Label runat="server" Text="Guardian Contact Info" ID="lblGuardianContactInfoCaption" /></label>
                                    <div class="field">
                                        <span class="indicator">
                                            <asp:Label runat="server" ID="lblGuardianContactInfo" />
                                        </span>
                                    </div>
                                    <div class="clear">
                                    </div>
                                </div>
                                <div class="row_curved" id="divGSRelationShip" runat="server" title="Example:UCSM, MIT, YTU">
                                    <label for="<%=ddlGSRelation.ClientID%>" class="mand_red">
                                        <asp:Label runat="server" Text="Guardian's Relation" ID="lblGSRelation" /></label>
                                    <div class="field">
                                        <span class="indicator">
                                            <asp:DropDownList runat="server" ID="ddlGSRelation" />
                                            <asp:RequiredFieldValidator ID="rfvGSRelation" ValidationGroup="GuardianProfile"
                                                ControlToValidate="ddlGSRelation" runat="server" CssClass="validationErrorControl"
                                                Display="Dynamic" ErrorMessage="" InitialValue="-1"></asp:RequiredFieldValidator>
                                        </span>
                                    </div>
                                    <div class="clear">
                                    </div>
                                </div>
                                <div class="row_curved" id="divSchoolList" runat="server" title="Example:UCSM, MIT, YTU">
                                    <label for="<%=ddlSchoolList.ClientID%>" class="mand_red">
                                        <asp:Label runat="server" Text="School Name" ID="Label2" /></label>
                                    <div class="field">
                                        <span class="indicator">
                                            <asp:DropDownList AutoPostBack="True" runat="server" ID="ddlSchoolList" OnSelectedIndexChanged="ddlSchoolList_SelectedIndexChanged"
                                                DataSourceID="odsSchoolProfileList" DataTextField="ListText" DataValueField="ListValue" />
                                            <asp:ObjectDataSource ID="odsSchoolProfileList" runat="server" DataObjectTypeName="SIS.ENT.Listing"
                                                DeleteMethod="Delete" OldValuesParameterFormatString="original_{0}" SelectMethod="GetList"
                                                TypeName="SIS.BLL.ListingManager" UpdateMethod="Save">
                                                <SelectParameters>
                                                    <asp:Parameter DefaultValue="1" Name="ListType" Type="Int32" />
                                                </SelectParameters>
                                            </asp:ObjectDataSource>
                                            <asp:RequiredFieldValidator ID="rfvSchoolList" ValidationGroup="StudentRegister"
                                                ControlToValidate="ddlSchoolList" runat="server" CssClass="validationErrorControl"
                                                Display="Dynamic" ErrorMessage="<br/>Please select a school name.<br/>"></asp:RequiredFieldValidator>
                                            &nbsp;&nbsp;
                                            <asp:Button Visible="false" runat="server" ID="btnShowSubject" Text="Show" OnClick="btnShowSubject_Click" />
                                        </span>
                                    </div>
                                    <div class="clear">
                                    </div>
                                </div>
                                <div class="row_curved" id="divSchoolMajor" runat="server" title="Example:UCSM, MIT, YTU">
                                    <label for="<%=ddlSchoolMajor.ClientID%>" class="mand_red">
                                        <asp:Label runat="server" Text="Major" ID="Label1" /></label>
                                    <div class="field">
                                        <span class="indicator">
                                            <asp:DropDownList AutoPostBack="True" runat="server" ID="ddlSchoolMajor" OnSelectedIndexChanged="ddlSchoolMajor_SelectedIndexChanged"
                                                DataSourceID="odsSchoolMajor" DataTextField="Description" DataValueField="SchoolMajorKey" />
                                            <asp:ObjectDataSource ID="odsSchoolMajor" runat="server" DeleteMethod="Delete" OldValuesParameterFormatString="original_{0}"
                                                SelectMethod="GetList" TypeName="SIS.BLL.SchoolMajorTableManager" DataObjectTypeName="SIS.ENT.SchoolMajorTable"
                                                UpdateMethod="Save">
                                                <DeleteParameters>
                                                    <asp:Parameter Name="SchoolMajorKey" Type="Int32" />
                                                </DeleteParameters>
                                                <SelectParameters>
                                                    <asp:ControlParameter ControlID="ddlSchoolList" Name="SchoolKey" PropertyName="SelectedValue"
                                                        Type="Int32" />
                                                </SelectParameters>
                                            </asp:ObjectDataSource>
                                            <asp:RequiredFieldValidator ID="rfvSchoolMajor" ValidationGroup="StudentRegister"
                                                ControlToValidate="ddlSchoolList" runat="server" CssClass="validationErrorControl"
                                                Display="Dynamic" ErrorMessage="<br/>Please select a school name.<br/>"></asp:RequiredFieldValidator>
                                        </span>
                                    </div>
                                    <div class="clear">
                                    </div>
                                </div>
                                <div class="row_curved" id="divStandardLevel" runat="server" title="Example:UCSM, MIT, YTU">
                                    <label for="<%=ddlStandardLevel.ClientID%>" class="mand_red">
                                        <asp:Label runat="server" Text="Standard/Level Name" ID="lblStandardLevel" /></label>
                                    <div class="field">
                                        <span class="indicator">
                                            <asp:DropDownList AutoPostBack="True" runat="server" ID="ddlStandardLevel" OnSelectedIndexChanged="ddlStandardLevel_SelectedIndexChanged"
                                                DataSourceID="odsStandarLevel" DataTextField="Description" DataValueField="StandardLevelKey"
                                                Style="height: 22px" />
                                            <asp:ObjectDataSource ID="odsStandarLevel" runat="server" OldValuesParameterFormatString="original_{0}"
                                                SelectMethod="GetList" TypeName="SIS.BLL.StandardLevelTableManager" DataObjectTypeName="SIS.ENT.StandardLevelTable"
                                                DeleteMethod="Delete" UpdateMethod="Save">
                                                <SelectParameters>
                                                    <asp:ControlParameter ControlID="ddlSchoolList" Name="SchoolKey" PropertyName="SelectedValue"
                                                        Type="Int32"></asp:ControlParameter>
                                                    <asp:ControlParameter ControlID="ddlSchoolMajor" Name="SchoolMajorKey" PropertyName="SelectedValue"
                                                        Type="Int32" />
                                                </SelectParameters>
                                            </asp:ObjectDataSource>
                                            <asp:RequiredFieldValidator ID="rfvStandardLevel" ValidationGroup="StudentRegister"
                                                ControlToValidate="ddlStandardLevel" runat="server" CssClass="validationErrorControl"
                                                Display="Dynamic" ErrorMessage="<br/>Please select a standard level.<br/>"></asp:RequiredFieldValidator>
                                        </span>
                                    </div>
                                    <div class="clear">
                                    </div>
                                </div>
                                <div class="row_curved" id="divLocation" runat="server" title="Example:UCSM, MIT, YTU">
                                    <label for="<%=ddlLocation.ClientID%>" class="mand_red">
                                        <asp:Label runat="server" Text="Location Name" ID="lblLocation" /></label>
                                    <div class="field">
                                        <span class="indicator">
                                            <asp:DropDownList AutoPostBack="True" runat="server" ID="ddlLocation" OnSelectedIndexChanged="ddlLocation_SelectedIndexChanged"
                                                DataSourceID="odsLocation" DataTextField="LocationName" DataValueField="LocationKey"
                                                Style="height: 22px" />
                                            <asp:ObjectDataSource ID="odsLocation" runat="server" OldValuesParameterFormatString="original_{0}"
                                                SelectMethod="GetList" TypeName="SIS.BLL.LocationTableManager" DataObjectTypeName="SIS.ENT.LocationTable"
                                                UpdateMethod="Save">
                                                <SelectParameters>
                                                    <asp:ControlParameter ControlID="ddlSchoolList" Name="SchoolKey" PropertyName="SelectedValue"
                                                        Type="Int32" />
                                                </SelectParameters>
                                            </asp:ObjectDataSource>
                                            <asp:RequiredFieldValidator ID="rfvLocation" ValidationGroup="StudentRegister" ControlToValidate="ddlLocation"
                                                runat="server" CssClass="validationErrorControl" Display="Dynamic" ErrorMessage="<br/>Please select a standard level.<br/>"></asp:RequiredFieldValidator>
                                        </span>
                                    </div>
                                    <div class="clear">
                                    </div>
                                </div>
                                <div class="row_curved" id="div7" runat="server" title="Example:UCSM, MIT, YTU">
                                    <label for="<%=ddlPeriod.ClientID%>" class="mand_red">
                                        <asp:Label runat="server" Text="Period" ID="lblPeriodCaption" /></label>
                                    <div class="field">
                                        <span class="indicator">
                                            <asp:DropDownList AutoPostBack="True" runat="server" ID="ddlPeriod" OnSelectedIndexChanged="ddlPeriod_SelectedIndexChanged"
                                                DataSourceID="sqlDSEduPeriod" DataTextField="Description" DataValueField="EducationPeriodKey"
                                                Style="height: 22px" />
                                            <asp:SqlDataSource ID="sqlDSEduPeriod" runat="server" ConnectionString="<%$ ConnectionStrings:sis.dbconn %>"
                                                SelectCommand="sprocEducationPeriodTableSelectList" SelectCommandType="StoredProcedure">
                                                <SelectParameters>
                                                    <asp:ControlParameter ControlID="ddlSchoolList" Name="SchoolKey" PropertyName="SelectedValue"
                                                        Type="Int32" />
                                                    <asp:ControlParameter ControlID="ddlLocation" Name="LocationKey" PropertyName="SelectedValue"
                                                        Type="Int32" />
                                                    <asp:ControlParameter ControlID="ddlStandardLevel" Name="StandardLevelKey" PropertyName="SelectedValue"
                                                        Type="Int32" />
                                                </SelectParameters>
                                            </asp:SqlDataSource>
                                            <asp:RequiredFieldValidator ID="rfvPeriod" ValidationGroup="StudentRegister" ControlToValidate="ddlPeriod"
                                                runat="server" CssClass="validationErrorControl" Display="Dynamic" ErrorMessage="<br/>Please select a period.<br/>"></asp:RequiredFieldValidator>
                                        </span>
                                    </div>
                                    <div class="clear">
                                    </div>
                                </div>
                                <%--<div class="row_curved" id="divClassRoom" runat="server">
                                    <label for="<%=ddlClassRoom.ClientID%>" class="mand_red">
                                        <asp:Label runat="server" Text="ClassRoom Name" ID="lblClassRoom" /></label>
                                    <div class="field">
                                        <span class="indicator">
                                            <asp:DropDownList AutoPostBack="True" runat="server" ID="ddlClassRoom" OnSelectedIndexChanged="ddlClassRoom_SelectedIndexChanged"
                                                DataSourceID="odsClassRoom" DataTextField="ClassRoomName" DataValueField="ClassRoomKey"
                                                Style="height: 22px" />
                                            <asp:ObjectDataSource ID="odsClassRoom" runat="server" OldValuesParameterFormatString="original_{0}"
                                                SelectMethod="GetList" TypeName="SIS.BLL.ClassRoomTableManager" DataObjectTypeName="SIS.ENT.ClassRoomTable"
                                                DeleteMethod="Delete" UpdateMethod="Save">
                                                <SelectParameters>
                                                    <asp:ControlParameter ControlID="ddlSchoolList" Name="SchoolKey" PropertyName="SelectedValue"
                                                        Type="Int32" />
                                                    <asp:ControlParameter ControlID="ddlLocation" Name="LocationKey" PropertyName="SelectedValue"
                                                        Type="Int32"></asp:ControlParameter>
                                                </SelectParameters>
                                            </asp:ObjectDataSource>
                                            <asp:RequiredFieldValidator ID="rfvClassRoom" ValidationGroup="StudentRegister" ControlToValidate="ddlClassRoom"
                                                runat="server" CssClass="validationErrorControl" Display="Dynamic" ErrorMessage="<br/>Please select a standard level.<br/>"></asp:RequiredFieldValidator>
                                        </span>
                                    </div>
                                    <div class="clear">
                                    </div>
                                </div>--%>
                                <div class="row_curved" id="divClassRoom" runat="server">
                                    <label>
                                        <asp:Label ID="Label5" Text="Class Room" runat="server"></asp:Label></label>
                                    <div class="field">
                                        <span class="indicator">
                                            <asp:DropDownList ID="ddlClassRoom" runat="server" DataSourceID="sqlDSClassRoom"
                                                DataTextField="ClassRoomDesc" DataValueField="ClassRoomKey" AutoPostBack="True"
                                                OnSelectedIndexChanged="ddlClassRoom_SelectedIndexChanged" />
                                            <asp:SqlDataSource ID="sqlDSClassRoom" runat="server" ConnectionString="<%$ ConnectionStrings:sis.dbconn %>"
                                                SelectCommand="sprocClassRoomTableSelectListView" SelectCommandType="StoredProcedure">
                                                <SelectParameters>
                                                    <asp:ControlParameter ControlID="ddlSchoolList" Name="SchoolKey" PropertyName="Text"
                                                        Type="Int32" />
                                                    <asp:ControlParameter ControlID="ddlLocation" Name="LocationKey" PropertyName="Text"
                                                        Type="Int32" />
                                                </SelectParameters>
                                            </asp:SqlDataSource>
                                        </span>
                                    </div>
                                    <div class="clear">
                                    </div>
                                </div>
                                <div class="row_curved" id="div8" runat="server">
                                    <label for="<%=ddlTimeTable.ClientID%>" class="mand_red">
                                        <asp:Label runat="server" Text="Time Table" ID="Label4" /></label>
                                    <div class="field">
                                        <span class="indicator">
                                            <asp:DropDownList AutoPostBack="True" runat="server" ID="ddlTimeTable" Style="height: 22px"
                                                DataSourceID="sqlDSTimeTable" DataTextField="TimeTableDesc" DataValueField="TimeTableKey"
                                                OnSelectedIndexChanged="ddlTimeTable_SelectedIndexChanged" />
                                            <asp:SqlDataSource ID="sqlDSTimeTable" runat="server" ConnectionString="<%$ ConnectionStrings:sis.dbconn %>"
                                                SelectCommand="sprocTimeTableSelectListByClassRoom" SelectCommandType="StoredProcedure">
                                                <SelectParameters>
                                                    <asp:ControlParameter ControlID="ddlSchoolList" Name="SchoolKey" PropertyName="SelectedValue"
                                                        Type="Int32" />
                                                    <asp:ControlParameter ControlID="ddlSchoolMajor" Name="SchoolMajorKey" PropertyName="SelectedValue"
                                                        Type="Int32" />
                                                    <asp:ControlParameter ControlID="ddlStandardLevel" Name="StandardLevelKey" PropertyName="SelectedValue"
                                                        Type="Int32" />
                                                    <asp:ControlParameter ControlID="ddlLocation" Name="LocationKey" PropertyName="SelectedValue"
                                                        Type="Int32" />
                                                    <asp:ControlParameter ControlID="ddlPeriod" Name="EduPeriodKey" PropertyName="SelectedValue"
                                                        Type="Int32" />
                                                    <asp:ControlParameter ControlID="ddlClassRoom" Name="ClassRoomKey" PropertyName="SelectedValue"
                                                        Type="Int32" />
                                                </SelectParameters>
                                            </asp:SqlDataSource>
                                            <asp:HyperLink runat="server" ID="hplViewTimeTableDetail" Text="Details" Target="_blank" />
                                            <asp:RequiredFieldValidator ID="rfvTimeTable" ValidationGroup="StudentRegister" ControlToValidate="ddlTimeTable"
                                                runat="server" CssClass="validationErrorControl" Display="Dynamic" ErrorMessage="<br/>Please select a timetable.<br/>"></asp:RequiredFieldValidator>
                                        </span>
                                    </div>
                                    <div class="clear">
                                    </div>
                                </div>
                                <div class="row_curved" id="div4" runat="server" title="Example:Only for BEHS 10. Not avialble now.">
                                    <label for="<%=txtRemark.ClientID%>" class="mand_red">
                                        <asp:Label runat="server" Text="Remark" ID="Label3" /></label>
                                    <div class="field">
                                        <span class="indicator">
                                            <asp:TextBox Width="270px" Rows="5" TextMode="MultiLine" Columns="50" ID="txtRemark"
                                                MaxLength="255" runat="server" />
                                            <%--<asp:RequiredFieldValidator ID="rfvRemark" ValidationGroup="ClassRoom" ControlToValidate="txtRemark"
                                                runat="server" CssClass="validationErrorControl" Display="Dynamic" ErrorMessage=""></asp:RequiredFieldValidator>--%>
                                        </span>
                                    </div>
                                    <div class="clear">
                                    </div>
                                </div>
                                <div class="row_curved" style="background-color: #efefef;" id="divButton" runat="server">
                                    <label>
                                        &nbsp;</label>
                                    <div class="field">
                                        <span class="indicator">
                                            <asp:Button ID="btnSubmit" CssClass="button_normal_submit" Text="Save" ValidationGroup="ClassRoom"
                                                OnClientClick="SubmitOnClientClick(this, 'ClassRoom');" runat="server" OnClick="btnSubmit_Click" /></span>
                                        &nbsp;&nbsp;<asp:Button runat="server" ID="btnAddNewSchool" Text="New" OnClick="btnAddNew_Click"
                                            Style="height: 26px" />
                                        &nbsp;&nbsp;<asp:Button runat="server" ID="btnDelete" OnClientClick="return confirm('Are you sure to delete?');"
                                            Text="Delete" OnClick="btnDelete_Click" />
                                    </div>
                                    <div class="clear">
                                    </div>
                                </div>
                                <div class="row_curved" id="divMessage" runat="server">
                                    <label>
                                        &nbsp;</label>
                                    <div class="field">
                                        <span class="indicator">
                                            <asp:Label ID="lblMessage" Font-Bold="true" runat="server"></asp:Label>
                                        </span>
                                    </div>
                                    <div class="clear">
                                    </div>
                                </div>
                            </td>
                        </tr>
                    </table>
                </fieldset>
            </div>
        </div>
    </div>

    <script type="text/javascript">
        //<![CDATA[
        SetSumitNormalButtonAttribute(document.getElementById('<=btnSubmit.ClientID>'));
        //]]>
    </script>

</asp:Content>
